﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical;
using Quartz.Logging;
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Text;
using VolPro.Core.Configuration;
using VolPro.Core.Controllers.Basic;
using VolPro.Core.Extensions;
using VolPro.Sys.IRepositories;
using System.Linq;
using VolPro.Core.WeChat;
using System.Threading.Tasks;

namespace VolPro.WebApi.Controllers
{
    [Route("api/weChart")]
    public class WeChartController : VolController
    {
        private WeChatService _chatService;
        public WeChartController(
            WeChatService chatService)
        {
            _chatService = chatService;
        }
        [Route("loginWX"),HttpPost,AllowAnonymous]
        public async Task<IActionResult> LoginWX(WeChatLoginInfo wxInfo)
        {
            UserOpenInfo openInfo=await _chatService.LoginWX(wxInfo);
            return Json(openInfo);
        }
    }
}

